package com.mdxx.redis;

import redis.clients.jedis.Jedis;

/**
 * Created by MD-1 on 2017/8/7.
 */
public class RedisTest {
    public static void main(String args[]){
        Jedis jedis=JedisFactory.get();
        jedis.setex("test.name",3,"鲁班七号");

        try {
            Thread.sleep(2500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("存在与否："+jedis.exists("test.name"));
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("存在与否："+jedis.exists("test.name"));
        jedis.close();
    }
}
